<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require_once '../class/chatroom.class.php';
require_once '../class/message.class.php';
require_once '../class/word_filter.class.php';

$rs = Chatroom::getMessagesByChatroom(1);

//$rs = new SplDoublyLinkedList();
$rs->rewind();
for ($i=0; $i<$rs->count(); $i++)
{
    $message = $rs->current();
    echo $message->getUser_name().": ".WordFilter::filter($message->getMessage_text())."<br>";
    $rs->next();
}